package com.wanji.sdk.impl.websocket;

import com.wanji.protocol.api.ByteBufEncoder;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.http.websocketx.TextWebSocketFrame;

public class WebSocketEncoder extends ByteBufEncoder<TextWebSocketFrame> {
    @Override
    protected TextWebSocketFrame toEncodedMessage(ChannelHandlerContext ctx, ByteBuf msg) {
        TextWebSocketFrame frame = new TextWebSocketFrame();
        frame.content().writeBytes(msg);
        return frame;
    }
}
